import { request } from "@/http/axios"
import {ref} from "vue";
import {useTransition} from "@vueuse/core";
export function indexBaseInfo() {
    return request({
        url: '/index/baseInfo',
        method: "get"
    })
}

export function getUserBaseInfo(id) {
    return request({
        url: '/index/baseUserInfo?userId='+id,
        method: "get"
    })
}
export function getTeacherBaseInfo(id) {
  return request({
    url: '/index/baseTeacherInfo?userId='+id,
    method: "get"
  })
}

// 获取项目折线图数据
export function getProjectLineData(data) {
    return request({
        url: 'index/projectLineData?type='+data,
        method: "get",
    })
}

export function getVisitViewsUsersCount(data) {
  return request({
    url: 'userprofile/getVisitViewsUsersCount?projectIds='+data,
    method: "get",
  })
}

export function getItemOutputValue(total) {
    const source = ref(0)
    const outputValue = useTransition(source, {
        duration: 1500,
    })
    source.value = Math.round(total)
    return outputValue
}

